Option Explicit
Sub F_Sample006()
    'Microsoft ActiveX Data Objects 2.X Library ]wޥζ
    'ոF_Data.csv 
    Dim myCon      As New ADODB.Connection
    Dim myRst      As New ADODB.Recordset
    Dim myCnc      As String
    Dim myCmd      As String
    Dim myFileName As String
    Dim i          As Long
    myFileName = "F_Data.csv"				'ŪJɮ
    myCnc = "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
    "DBQ=" & ThisWorkbook.Path & "\;"
    myCmd = "SELECT * FROM " & myFileName
    myCon.Open "Provider=MSDASQL;" & myCnc
    myRst.Open Source:=myCmd, ActiveConnection:=myCon
    Worksheets.Add
    With myRst
        'W
        For i = 1 To .Fields.Count
            Cells(1, i).Value = .Fields(i - 1).Name
        Next
        'O
        Range("A2").CopyFromRecordset myRst
        .Close
    End With
    myCon.Close
    Set myRst = Nothing						'
    Set myCon = Nothing
End Sub
